﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Security;

public partial class RetrivePassword : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void btnRetrieve_Click(object sender, ImageClickEventArgs e)
    {
        BintjeMembershipProvider prov = new BintjeMembershipProvider();
        if (!bool.Parse(prov.GetPassword(PasswordRecovery1.UserName, (PasswordRecovery1.Controls[0].FindControl("Email") as TextBox).Text)))
        {
            Literal ftext = PasswordRecovery1.Controls[0].FindControl("FailureText") as Literal;
            if (null != ftext)
            {
                ftext.Visible = true;
                ftext.Text = "Failed to retrieve password!";
            }
            
        }
        else
        {
            Response.Redirect("~/Login.aspx");
        }
        

        
    }
}
